<template>
	<view class="index">
		<view class="item">
			<view class="label">退款单号</view>
			<view class="value">{{ info.outRefundNo || '-' }}</view>
		</view>
		<view class="item">
			<view class="label">退款状态</view>
			<view class="value">
				<text v-if="info.refundStatus === 1" style="color: #339b5d">已退款</text>
				<text v-else-if="info.refundStatus === 2" style="color: red;">退款失败</text>
				<text v-else-if="info.refundStatus === 0" style="color: orange;">待退款</text>
			</view>
		</view>
		<view class="item">
			<view class="label">退款金额</view>
			<view class="value">{{ (info.amount / 100).toFixed(2) }}元</view>
		</view>
		<!-- <view class="item">
			<view class="label">客户名称</view>
			<view class="value">{{ info.customerPetName }}</view>
		</view> -->
		<view class="item">
			<view class="label">退款原因</view>
			<view class="value">{{ info.remark }}</view>
		</view>
		<view class="item">
			<view class="label">供应商名称</view>
			<view class="value">{{ info.supplierName }}</view>
		</view>
		<view class="item">
			<view class="label">商品名称</view>
			<view class="value">{{ info.productName }}</view>
		</view>

		<view class="item">
			<view class="label">退款时间</view>
			<view class="value">{{ info.refundTime || '-' }}</view>
		</view>
		<view class="item">
			<view class="label">创建时间</view>
			<view class="value">{{ info.createTime || '-' }}</view>
		</view>
		<view class="item" v-if="info.refundType === 9" @click="goAfterSale">
			<view class="label">售后单</view>
			<view class="value">查看</view>
			<uni-icons type="right" color="#999999" size="14"></uni-icons>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			}
		},
		onLoad(option) {
			this.info = JSON.parse(option.info)
		},
		methods: {
			goAfterSale() {
				uni.navigateTo({
					url: '/subPage_afterSale/detail?id=' + this.info.afterSalesId
				})
			}
		},
		components: {

		}
	}
</script>

<style lang="scss" scoped>
	.index {
		.item {
			min-height: 90rpx;
			display: flex;
			align-items: center;
			font-size: 32rpx;
			background-color: #ffffff;
			border-top: 1rpx solid #efefef;
			padding: 10rpx 20rpx;
			box-sizing: border-box;

			.label {
				color: #222222;
			}

			.value {
				flex: 1;
				text-align: right;
				margin-left: 30rpx;
				color: #434343;
			}
		}
	}
</style>
